home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Applications / CC Converter 1.1.1 / Scripts / MicroPhone™ / CAUL download search next >
Text File  |  1994-03-21  |  2KB  |  54 lines

  1.  Settings File = script test
  2.  Script Name = CAUL download search
  3.  Command Key = 
  4.  F-Key = 
  5.  Menu = YES
  6.  Button = NO
  7.  Version = 5001
  8.  System = Macintosh
  9.  
  10. Remark "Script that automates downloading searches from the CAUL Current Contents"
  11. Remark "database. It should only be run from the Browse List menu."
  12. Remark "The user is prompted for the name of the new file and for"
  13. Remark "the number of items."
  14. Remark "© Kevin Sanderson 1994"
  15. Remark "###  Get the name/location of a file to save to"
  16. Set Variable * captureFile from New File Dialog "'Save Search As: ' , 'CC search'"
  17. If Expression "Length( captureFile ) <= 0"
  18.   Remark "###  User selected cancel so abort quietly"
  19.   Delete Variable captureFile
  20.   Abort Script
  21. End If
  22. Remark "###  Get the number of items to capture"
  23. Set Variable * nosItems from Dialog Box "'Enter number or range of items to display, eg 23 or 1-5 or all' , 'all'"
  24. If Expression "Length( nosItems ) <= 0"
  25.   Remark "###  User did not enter a value"
  26.   Alert * OK "'Script aborted as no selection was made.'"
  27.   Delete Variable nosItems
  28.   Delete Variable captureFile
  29.   Abort Script
  30. End If
  31. Set Variable * moreItems from Expression "TRUE"
  32. Remark "###  Capture the info as it appears on the screen"
  33. Open Capt. File * from Screen "captureFile"
  34. Send Text String "nosItems&'^M'"
  35. Remark "###  Continue sending a return (to display the next page) until"
  36. Remark "###  all the info has been displayed"
  37. Repeat
  38.   When Text in Stream is "'END OF D'"
  39.     Remark "###  End of display"
  40.     Set Variable * moreItems from Expression "FALSE"
  41.   Or When Text in Stream is "'ENTER'"
  42.     Remark "###  more items to display so send a return"
  43.     Send Text String "'^M'"
  44.   Or When Seconds Have Passed "15"
  45.     Remark "###  timeout or some other error"
  46.     Alert * OK "'Aborting script. The response timed out or there was some other error.'"
  47.     Set Variable * moreItems from Expression "FALSE"
  48.   End When
  49. Until Expression "moreItems = FALSE"
  50. Capture * Off
  51. Delete Variable nosItems
  52. Delete Variable moreItems
  53. Delete Variable captureFile
  54.